<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of conference
 *
 * @author Dmitry
 */
class Controller_Conference extends Controller_Action {
  function index()
  {
    $this->registry->get('view')->show('aboutconf');
  }
  
  function register()
  {
    $this->registry->get('view')->set('name','');
    $this->registry->get('view')->set('secondName','');
    $this->registry->get('view')->set('thirdName','');
    $this->registry->get('view')->set('degree','');
    $this->registry->get('view')->set('position','');
    $this->registry->get('view')->set('organization','');
    $this->registry->get('view')->set('address','');
    $this->registry->get('view')->set('telephone','');
    $this->registry->get('view')->set('fax','');
    $this->registry->get('view')->set('email','');
    $this->registry->get('view')->set('report','');
    $this->registry->get('view')->set('section','');
    $this->registry->get('view')->show('register');
  }
  
  function check()
  {
    $conf = new Models_Conference();
    $validate = $conf->validate($_POST);
    $this->registry->get('view')->set('name',$_POST['name']);
    $this->registry->get('view')->set('secondName',$_POST['secondname']);
    $this->registry->get('view')->set('thirdName',$_POST['thirdname']);
    $this->registry->get('view')->set('degree',$_POST['degree']);
    $this->registry->get('view')->set('position',$_POST['position']);
    $this->registry->get('view')->set('organization',$_POST['organization']);
    $this->registry->get('view')->set('address',$_POST['address']);
    $this->registry->get('view')->set('telephone',$_POST['telephone']);
    $this->registry->get('view')->set('fax',$_POST['fax']);
    $this->registry->get('view')->set('email',$_POST['email']);
    $this->registry->get('view')->set('report',$_POST['report']);
    $this->registry->get('view')->set('section',$_POST['section']);
    if($validate)
    {
      $this->registry->get('view')->set('validate',$validate);
      $this->registry->get('view')->show('register');
    } else {
      $this->registry->get('view')->show('done');
    }
  }
}